package com.itheima.test6;

public class Test {


    public static void main(String[] args) {
        //goSwimming(new SwimmingImpl());
        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("铁汁,我们去游泳吧");
            }
        });
        goSwimming(() -> System.out.println("铁汁,我们去游泳吧"));


    }

    public static void goSwimming(Swimming swim){
        swim.swim();

    }
    public static void goFu(Fu fu){
        fu.swim();

    }
}
interface  Swimming{

    void swim();

}

abstract class Fu{

    abstract void swim();
}
class SwimmingImpl implements Swimming{

    @Override
    public void swim() {
        System.out.println("铁汁,我们去游泳吧");
    }
}